package com.example.customview.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import com.example.customview.R;
import com.example.customview.recyclerview.BaseUseActivity;

public class RecyclerViewActivity extends AppCompatActivity implements View.OnClickListener {
    private static final String TAG = "RecyclerViewActivity";

    private Button mRecyclerViewBase;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_recycler_view);
        initView();
    }

    private void initView() {
        mRecyclerViewBase = findViewById(R.id.recycler_view_base);
        setOnClick();
    }

    private void setOnClick() {
        mRecyclerViewBase.setOnClickListener(this::onClick);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.recycler_view_base:
                Intent intent = new Intent();
                intent.setClass(this, BaseUseActivity.class);
                startActivity(intent);
                break;
            default:
                Log.i(TAG,"is jump error");
        }
    }
}